package com.yueyang.sojourn.server.controller.wx;

import com.yueyang.sojourn.server.common.LoginNeedless;
import com.yueyang.sojourn.server.model.vo.SojournLayoutVo;
import com.yueyang.sojourn.server.service.sojourn.layout.ReadLayoutService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yemingxing
 * @summary
 * @Copyright (c) 2020, Yueyang Group All Rights Reserved.
 * @since 2020-02-29 17:33
 */
@RestController
@Api(tags = "(小程序)楼层 API")
@RequestMapping("/api/wx/layout")
public class ApiLayoutController {

    @Autowired
    private ReadLayoutService readLayoutService;

    @LoginNeedless
    @ApiOperation(value = "查询楼层配置", notes = "楼层类型定义见枚举 layoutType")
    @GetMapping("/type/{layoutType}")
    public SojournLayoutVo findLayout(@PathVariable int layoutType) {
        return readLayoutService.findWxLayout(layoutType);
    }
}
